<?php error_reporting(0) ?>
<div class="navbar" >
    <div class="navbar-inner" style="position:relative">
        <h6><i class="icon-list"></i><?php echo ucwords(!empty($type)?$type:'Event') ?></h6>
    </div>
</div>
<ul class="toolbar">
    <li><a href="#" title="Add entry" onclick="TC_EVENT.onSave()"><i class="icon-save"></i><span>DONE</span></a></li>
    <li><a href="#" title="Refresh" onclick="TC_EVENT.onCancel()"><i class="icon-list"></i><span>CANCEL</span></a></li>
</ul>
<div class="widget row-fluid">
    <div class="well form-horizontal">
        <input 
            type="hidden" 
            value="<?php echo $item->_id ?>" 
            id="_id" name="_id"
            />
        <form id="_form_edit_panel" name="_form_edit_panel" 
              action="" method="POST" onsubmit="return false;"
              target="integration_asynchronous" autocomplete="off">
            <div class="widget- row-fluid">
                <div class="well form-horizontal" style="border:none">
                    <div class="control-group">
                        <label class="control-label">Title :</label>
                        <div class="controls">
                            <input type="text" 
                                   class="span12 validate[required]"
                                   data-prompt-position="topLeft:-1,-5"
                                   id="_name" name="_name" 
                                   value="<?php echo quotes_to_entities($item->_name) ?>"
                                   />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">Address :</label>
                        <div class="controls">
                            <input type="text" 
                                   class="span12 validate[required]"
                                   data-prompt-position="topLeft:-1,-5"
                                   id="_address" name="_address" 
                                   value="<?php echo quotes_to_entities($item->_address) ?>"
                                   />
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">&nbsp;</label>
                        <div class="controls">
                            <div class="span6">
                                <div>Phone</div>
                                <input type="text" 
                                    class="span12"
                                    id="_phone" name="_phone" 
                                    value="<?php echo $item->_phone ?>"
                                    />
                            </div>
                            <div class="span6">
                                <div>Fax</div>
                                <input type="text" 
                                    class="span12"
                                    id="_fax" name="_fax" 
                                    value="<?php echo $item->_fax ?>"
                                    />

                            </div>
                        </div>
                    </div>

                    <div class="control-group">
                        <label class="control-label">Thumb :</label>
                        <div class="controls">
                            <input type="text" 
                                   class="span12 "
                                   data-prompt-position="topLeft:-1,-5"
                                   id="_thumb" name="_thumb" 
                                   value="<?php echo quotes_to_entities($item->_thumb) ?>"
                                   />
                            <i class="icon-picture field-icon" style="cursor:pointer" 
                                    onclick="BrowseServer('#_thumb')"
                                    title="CHOOSE IMAGE"></i>
                        </div>
                    </div>

                    <?php if($type=='location') { ?>
                    
                    <div class="control-group">
                        <label class="control-label">Map</label>
                        <div class="controls">
                            <div class="span6">
                                <div>Latitude</div>
                                <input type="text" 
                                    class="span12"
                                    id="_lat" name="_lat" 
                                    value="<?php echo $item->_lat ?>"
                                    />
                            </div>
                            <div class="span6">
                                <div>Longitude</div>
                                <input type="text" 
                                    class="span12"
                                    id="_lon" name="_lon" 
                                    value="<?php echo $item->_lon ?>"
                                    />

                            </div>
                        </div>
                    </div>
                    
                    <?php } ?>

                    <div class="control-group">
                        <label class="control-label">Content :</label>
                        <div class="controls">
                            <textarea 
                                id="_content" name="_content" 
                                class="span12 validate[required]"
                                data-prompt-position="topLeft:-1,-5"
                                ><?php echo ($item->_content) ?></textarea>
                        </div>
                    </div>
                    
                    <div class="control-group">
                        <label class="control-label">&nbsp;</label>
                        <div class="controls">
                            <div class="span6">
                                <div>POSITION</div>
                                <input type="number" 
                                    class="span12"
                                    id="_position" name="_position" 
                                    value="<?php echo $item->_position ?>"
                                    />
                            </div>
                            <div class="span6">
                                <div>STATUS</div>
                                <select id="_status" name="_status" class=" span12">
                                    <option value="true" <?php if ($item->_status != 'false') echo 'selected=1' ?>>ENABLE</option>
                                    <option value="false">DISABLE</option>
                                </select>

                            </div>
                        </div>
                    </div>

                    <input type="hidden" 
                           id="_type" name="_type" 
                           value="<?php echo !empty($item->_type) ? quotes_to_entities($item->_type) : $type ?>"
                           />


                    <div class="control-group">
                        <label class="control-label">&nbsp;</label>
                        <div class="controls">
                            <div>
                                <?php if (!empty($item->_insert)) echo "Created  : $item->_insert" ?>
                            </div>
                            <div>
                                <?php if (!empty($item->_update)) echo "Modified : $item->_update" ?>
                            </div>
                        </div>
                    </div>

                </div>
            </div>

        </form>
    </div>
</div>